package com.topisv.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.Area;
import com.topisv.tms.entity.Brand;

public interface BrandDao extends PagingAndSortingRepository<Brand, Long>, JpaSpecificationExecutor<Brand> {
	
	
	@Query("select brand from Brand brand where brand.customers.id=?")
	List<Brand> findBrands(Long customersId);
	@Modifying
	@Query("select b from Brand b where b.customers.id = ?1")
	List<Brand> getBrandsByCustomerId(Long id);

}
